package com.bdult.vh.dao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;


@Repository
public class MemberDAO implements CommonDAO {
	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;
	
	public HashMap<String,String> loginCheck(HashMap map) {
		return (HashMap<String,String>)sqlSessionTemplate.selectOne("loginCheck", map);
	}
	
	public int idCheck(String id) {
		return (Integer)sqlSessionTemplate.selectOne("idCheck", id);
	}
	
	public int isMember(Map<String, String> paramMap) {
		return (Integer)sqlSessionTemplate.selectOne("isMember", paramMap);
	}
	
	public int isMember2(Map<String, String> paramMap) {
		return (Integer)sqlSessionTemplate.selectOne("isMember2", paramMap);
	}
	
	public HashMap<String, Object> getMemberData(Map<String, String> paramMap) {
		return (HashMap<String, Object>)sqlSessionTemplate.selectOne("getMemberData", paramMap);
	}
	
	public int insertMember(Map<String, Object> paramMap) {
		return (Integer)sqlSessionTemplate.insert("insertMember", paramMap);
	}
	
	public int updateMemberPSWD(Map<String, Object> paramMap) {
		return (Integer)sqlSessionTemplate.update("updateMemberPSWD", paramMap);
	}
	
	public int dropMember(Map<String, Object> paramMap) {
		return (Integer)sqlSessionTemplate.delete("dropMember", paramMap);
	}
	
	//김진영 과장님 작업 - 포인트 조회
	public HashMap<String, Object> getMemberPoint(Map<String, Object> paramMap) {
		return (HashMap<String, Object>)sqlSessionTemplate.selectOne("getMemberPoint", paramMap);
	}
	
	
	//########## 2014-05-01 심윤 추가 : 주문페이지 회원정보 호출
	public HashMap<String, Object> getMemberView(String CSTMID) {
		return (HashMap<String, Object>)sqlSessionTemplate.selectOne("getMemberView", CSTMID);
	}
	
	
	
}
